<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="UTF-8">
      <title>本地存储</title>
   </head>
   <body>
      <script>
         const person = {
            name: '张三',
            age: 18
         };
         localStorage.setItem('person', JSON.stringify(person))
         console.log(localStorage.getItem('person'))
         console.log(JSON.parse(localStorage.getItem('person')))
      </script>
   </body>
</html>